package com.app.controller;


import com.app.common.Result;
import com.app.model.TbContentEnt;
import com.app.service.ITbContentEntService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 创业介绍板块 前端控制器
 * </p>
 *
 * @author yoominic
 * @since 2024-05-06
 */
@RestController
@RequestMapping("/tbContentEnt")
public class TbContentEntController {

    @Autowired
    private ITbContentEntService iTbContentEntService;

    /**
     * 列表
     *
     * @return {@link Result}
     */
    @GetMapping("list")
    public Result list()
    {
        QueryWrapper<TbContentEnt> contentEntQueryWrapper=new QueryWrapper<>();
        contentEntQueryWrapper.eq("status",1);
        contentEntQueryWrapper.orderByAsc("sort");
        return Result.success(this.iTbContentEntService.list(contentEntQueryWrapper));
    }

    /**
     * 获取
     * 列表
     *
     * @param id id
     * @return {@link Result}
     */
    @GetMapping("get")
    public Result get(@RequestParam(value = "id") Integer id)
    {
        return Result.success(this.iTbContentEntService.getById(id));
    }
}

